/*
 * OptimalTree.cpp
 *
 *  Created on: 14 nov. 2011
 *  Authors: bnoleau, cybourdi, rlecrois
 */

#include "OptimalTree.h"

OptimalTree::OptimalTree() {
}

OptimalTree::~OptimalTree() {
}

list<int> OptimalTree::vertexCover(Graph* g) {
	list<int> cover;
	while(g->hasLeaf()){
		Node* father = g->getFatherOfLeaf();
		g->eraseEdgesOfNode(father);
		cover.push_back(father->getID());
	}
	return cover;
}
